package main

import (
	"encoding/json"
	"fmt"
	"log"
)

type Movie struct {
	Title string
	Year int `json:"released"`
	Color bool `json:"color,omitempty"`
	Actors []string
}

var movies = []Movie{
	{Title: "Casablanca", Year: 1942, Color: false, Actors: []string{"Humphrey Bogart", "Ingrid Bergman"}},
	{Title: "Cool Hand Luke", Year: 1967, Color: true, Actors: []string{"Paul Newman"}},
	{Title: "Bullitt", Year: 1968, Color: true, Actors: []string{"Steve McQueen", "Jacqueline Bisset"}},
}

func main() {
	
	data1, err1 := json.MarshalIndent(movies, "", "    ")
	if err1 != nil {
		log.Fatalf("JSON marshaling indent failed: %s", err1)
	}
	fmt.Printf("JSON marshaling indent: %s\n", data1)

	data2, err2 := json.Marshal(movies)
	if err2 != nil {
		log.Fatalf("JSON marshaling failed: %s", err2)
	}
	fmt.Printf("JSON marshaling: %s\n", data2)
}